# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------


""" A ScheduleProvider Service Provider """
from ..TaskHandler import TaskHandler
from ..commands import MakeTaskCommand, ScheduleRunCommand
from ...providers import Provider


class ScheduleProvider(Provider):
    def __init__(self, application):
        self.application = application

    def register(self):
        self.application.make("commands").add(
            MakeTaskCommand(self.application), ScheduleRunCommand(self.application)
        )

        self.application.bind("scheduler", TaskHandler(self.application))

    def boot(self):
        pass
